<%@ page language="java" contentType="text/html;charset=UTF-8" %><%@ include file="../../inc/global.jsp" 
%>
<!doctype html>
<html>
<head>
<title>${adminGlobalConfig.name}</title>
<%@include file="../head.jsp" %>
<style type="text/css">
#ajaxData table{width:98%;  margin:0px auto 3px auto; border-collapse: collapse;}
#ajaxData table tr th {color:#666;}
#ajaxData table tr th, #ajaxData table tr td{border-bottom:1px solid #ccc;}
</style>
<script type="text/javascript">
$(function(){
	$('#q').focus();	
});
function ConfirmFunc() {
	this.show = function(cid) {
		
	};
}
var cfrm = new ConfirmFunc();
</script>
</head>
<body>
<div class="wrapper">
<%@include file="../header.jsp" %>
<div class="body">
<div class="list">
<div class="listnav">
<form action="search" method="get">
<input type="text" id="q" name="q" value="${q}" />
<input type="submit" name="" value="<fmt:message key="message.find.sure" />" />
</form>
</div>
<table>
<thead>
<tr>
<th style="width:30px;"></th>
<th>姓名</th>
<th>村庄</th>
<th>移动电话</th>
<th>余额</th>
<th>债务</th>
<th>备注</th>
<th>对账</th>
<c:if test="${CUSTOMER_MODIFY }">
<th style="width:30px;">修改</th>
</c:if>
</tr>
</thead>
<c:if test="${empty(customerVOList)}">
<tr>
<td></td>
<td></td>
<td>暂无数据...</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</c:if>
<tbody>
<c:forEach var="item" items="${customerVOList}" varStatus="s">
<c:choose>
<c:when test="${(s.index % 2) != 0}">
<tr class="trbg">
</c:when>
<c:otherwise>
<tr>
</c:otherwise>
</c:choose>
<td>
<c:if test="${Pagination.page > 1}">
${Pagination.maxResults*(Pagination.page-1) + (s.index+1)}
</c:if>
<c:if test="${Pagination.page == 1}">
${s.index+1}
</c:if>
</td>
<td>${item.name}</td>
<td><a href="?villageId=${item.village.id}">${item.town.name}${item.village.name}</a></td>
<td>${item.mobile}</td>
<td><a href="###" onclick="customer.showAccount('${item.id}')">${item.balance}</a></td>
<td>${item.debt}</td>
<td>
<c:out value="${item.memo}" escapeXml="false" />
</td>
<c:if test="${CUSTOMER_MODIFY }">
<td><a href="###" onclick="customer.billSearch('${item.id}')">对账</a></td>
<td><a href="./form?id=${item.id}">修改</a></td>
</c:if>
</tr>
</c:forEach>
</tbody>
</table>
${pagination}
</div>
<div class="sidebarMenu">
<ul>
<c:if test="${CUSTOMER_MODIFY }">
<li><a href="/a/customer/form">新增顾客信息</a></li>
</c:if>
</ul>
</div>
<div class="sidebar">
<div class="prop-item">
<c:if test="${villageId == null}">
<em class="current"><a href="/a/customer/list">全部</a></em>
</c:if>
<c:if test="${villageId != null}">
<em><a href="/a/customer/list">全部</a></em>
</c:if>
<c:forEach var="vo" items="${villageVOList}">
<em id="${vo.town.id}">${vo.town.name}</em>
<c:forEach var="village" items="${vo.villageList}">
<c:if test="${!(villageId eq village.id)}">
<a href="?villageId=${village.id}">${village.name}<span><c:if test="${village.count!=null}">(${village.count})</c:if></span></a>
</c:if>
<c:if test="${villageId eq village.id}">
<a href="?villageId=${village.id}" class="current">${village.name}<span><c:if test="${village.count!=null}">(${village.count})</c:if></span></a>
</c:if>
</c:forEach>
</c:forEach>
</div>
</div>
<!--  -->
</div>
</div>
</body>
</html>